package fx.componet;

import com.jfoenix.assets.JFoenixResources;
import com.jfoenix.controls.JFXProgressBar;
import fx.protocol.Anchor;
import fx.protocol.Propertify;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.scene.Node;

public class MyJFXProgressBar extends JFXProgressBar implements Anchor, Propertify<Double> {

    private final SimpleDoubleProperty property = new SimpleDoubleProperty();

    public MyJFXProgressBar() {
        progressProperty().bind(property);
    }

    public String getUserAgentStylesheet() {
        return JFoenixResources.load("/css/jfx-progress-bar.css").toExternalForm();
    }

    @Override
    public Node anchorEle() {
        return this;
    }

//    public double getProperty() {
//        return property.get();
//    }
//
//    public SimpleDoubleProperty propertyProperty() {
//        return property;
//    }

    @Override
    public void update(Double o) {
        property.set(o);
    }
}
